package com.guigu.tms.commons.order.feign;

import com.github.pagehelper.PageInfo;
import com.guigu.tms.commons.order.entity.Order;
import com.guigu.tms.commons.order.entity.vo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "tms-oms",path ="oms/order" ,contextId = "orders")
public interface OrderFeignClient {

    @PostMapping("getOrders/{num}/{size}")
    PageInfo<Order> getOrders(@RequestBody Order order, @PathVariable("num") Integer num, @PathVariable("size") Integer size);

    @PostMapping("createOrder")
    boolean createOrder(@RequestBody Order order);

    @PutMapping("updateOrder/{orderId}")
    Result updateOrder(@RequestBody Order order, @PathVariable("orderId") String OrderId);

    @PutMapping("cancelOrder/{orderId}")
    Result cancelOrder(@PathVariable("orderId") String OrderId,@RequestParam String cases);

    @GetMapping("getOrdersByMemberId")
    List<Order> getOrdersByMemberId(@RequestParam String memberId);

    @GetMapping("getOrdersByMobile")
    List<Order> getOrdersByMobile(@RequestParam String phone);


    @GetMapping("getOrderDetails/{orderId}")
    Order getOrderDetails(@PathVariable("orderId") String OrderId);

    @PostMapping("getOrderPrice")
    String getOrderPrice(@RequestBody Order order);

    @PostMapping("getOrdersByOrder")
    List<Order> getOrdersByOrder(@RequestBody Order order);

    @PutMapping("updateOrdeInfo")
    boolean updateOrderInfo(@RequestBody Order order);

    @GetMapping("getCourierId")
    String getCourierId(@RequestParam("position") String position);

}
